# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-hatch-requirements-txt
pkgver=0.4.0
pkgrel=1
pkgdesc='Hatchling plugin to read project dependencies from requirements.txt'
arch=('any')
url='https://github.com/repo-helper/hatch-requirements-txt'
license=('MIT')
depends=(
  'python'
  'python-hatchling'
  'python-packaging'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
)
#checkdepends=('')
#optdepends=('')
_commit='9a219c45e66c9083c8a657e15f37f113fe8d8269'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
